package com.sky.mapper;

import com.sky.annotation.AutoFill;
import com.sky.entity.Dish;
import com.sky.enumeration.OperationType;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface DishMapper {
	List<Dish> getDishBy(String name, Long categoryId, Integer status, Long... id);
	
	@AutoFill(OperationType.INSERT)
	void insert(Dish dish);
	
	Integer deleteDish(List<Long> ids);
	
	@AutoFill(OperationType.UPDATE)
	void updateDish(Dish dish);
	
	@Select("select * from sky_take_out.dish where category_id = #{categoryId};")
	List<Dish> getByCategoryId(Long categoryId);
}
